package com.sunnada.edu.mobile.login.dao;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.stereotype.Repository;

import com.sunnada.edu.system.pub.dao.BaseDaoImpl;



@Repository
public class PhoneLoginDaoImpl extends BaseDaoImpl implements PhoneLoginDao {
	public List findModules(HashMap<String, String> params) {
		return selectList("phonelogin_sqlmap.findModules", params);
	}
	public Map getUserByUserId(HashMap<String, String> params) {
		List list = selectList("phonelogin_sqlmap.getUserByUserId", params);
		if(list!=null&&list.size()>0){
			return (Map)list.get(0);  
		}
		return null;
	}
	@Override
	public Map getEmployeeByEmployeeId(HashMap<String, String> params) {
		List list = selectList("phonelogin_sqlmap.getEmployeeByEmployeeId", params);
		if(list!=null&&list.size()>0){
			return (Map)list.get(0);  
		}
		return null;
	}
	@Override
	public List findModulesForEmployee(HashMap<String, String> params) {
		return selectList("phonelogin_sqlmap.findModulesForEmployee", params);
	}
	@Override
	public List findModulesForDeveloper(HashMap<String, String> params) {
		return selectList("phonelogin_sqlmap.findModulesForDeveloper", params);
	}
	@Override
	public Map getDeveloperByDeveloperId(HashMap<String, String> params) {
		List list = selectList("phonelogin_sqlmap.getDeveloperByDeveloperId", params);
		if(list!=null&&list.size()>0){
			return (Map)list.get(0);  
		}
		return null;
	}
	@Override
	public boolean isSmsCodeOk(HashMap<String, String> params) {
		List list = selectList("phonelogin_sqlmap.isSmsCodeOk", params);
		if(list!=null&&list.size()>0){
			return true;
		}
		return false;
	}
	@Override
	public int deletSemsCode(HashMap<String, String> params) {
		return delete("phonelogin_sqlmap.deletSemsCode",params);
	}
	@Override
	public int addUserLog(HashMap<String, String> params) {	
		return insert("phonelogin_sqlmap.addUserLog",params);
	}
	@Override
	public boolean selectUserlog(HashMap<String, String> params) {
	    List list= selectList("phonelogin_sqlmap.selectUserlog", params);
	    if(list!=null&&list.size()>0){
	    	return true;
	    }
		return false;
	}
	@Override
	public List<HashMap<String, String>> getUserMobileMenus(
			HashMap<String, String> params) {
		return selectList("phonelogin_sqlmap.getUserMobileMenus", params);
	}
}
